Further shadow_mem_control fixes -- we need to balloon the amount of memory
authorEwan Mellor <ewan@xensource.com>
Wed, 30 Aug 2006 10:05:00 +0000 (11:05 +0100)
committerEwan Mellor <ewan@xensource.com>
Wed, 30 Aug 2006 10:05:00 +0000 (11:05 +0100)
that we're going to request i.e. the rounded-up value.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomainInfo.py

index fbb60c0c302015ced5e8df110d043fc0a8b383e6..a7a388bbea20350fbb846d4eef13e495177a4357 100644 (file)
@@ -1296,13 +1296,13 @@ class XendDomainInfo:
             shadow_kb_req = self.info['shadow_memory'] * 1024
             if shadow_kb_req > shadow_kb:
                 shadow_kb = shadow_kb_req
+            shadow_mb = (shadow_kb + 1023) / 1024
 
             # Make sure there's enough RAM available for the domain
-            balloon.free(mem_kb + shadow_kb)
+            balloon.free(mem_kb + shadow_mb * 1024)
 
             # Set up the shadow memory
-            shadow_cur = xc.shadow_mem_control(self.domid,
-                                               (shadow_kb + 1023) / 1024)
+            shadow_cur = xc.shadow_mem_control(self.domid, shadow_mb)
             self.info['shadow_memory'] = shadow_cur
 
             # initial memory allocation